<script>
    jxt.pages.newJson = function(dataJson, attrs) {

        if (!dataJson) dataJson = jxt.pages.dataJson;
        var _self = jxt.tag.newJson(dataJson);
        _self.id = jxt.pages.dataJson.id;
        _self.children = [];
        var title;
        if (attrs) title = attrs.title;
        if (!title) title = jxt.pages.dataJson.init.title;
        _self.title = title;
        return _self;

    };
    jxt.pages.render = function(node, edit, parentTag) {
        node.pageid = pageid;
        jxt.tag.render(node, edit, parentTag);
    };
    jxt.pages.children = jxt.tag.children;
    jxt.pages.add = function() {

        jxt.data[0].children.push(jxt.data[0].children.length + 1);
        jxt.render(jxt.data[0].id, true);
        console.log("add");
        jxt.saveJson();
    };
</script>